//-------------------------------------------------------------------
//	Copyright (c) 2013-2014  Zhirnov Andrey
//	This file is part of the "UX OpwnGL Framework" project.
//	See copyright notice in "UX_GL_Framework.h".
//-------------------------------------------------------------------

#pragma once

#include <Includes.h>

namespace Framework
{

	//
	// DevIL Wrapper
	//

	struct UX_EXPORT ImageLoader
	{
		// load //
		static bool Load (GLTexture2DPtr &tex, uni_c_string filename, bool genMipmaps = true);

		static bool Load (GLTextureCubePtr &tex, uni_c_string filename, bool genMipmaps = true);

		static bool Load (GLTextureCubePtr &tex,
						  uni_c_string positiveX, uni_c_string negativeX,
						  uni_c_string positiveY, uni_c_string negativeY,
						  uni_c_string positiveZ, uni_c_string negativeZ,
						  bool genMipmaps = true);

		static bool Load (GLTexture2DArrayPtr &tex, const uni_array< uni_c_string > &filenames, bool genMipmaps = true);

		static bool Load (GLTexture3DPtr &tex, uni_c_string filename, bool genMipmaps = true);


		static bool Load2D (GLTexturePtr &tex, uni_c_string filename, bool genMipmaps = true) {
			return Load( (GLTexture2DPtr &)tex, filename, genMipmaps );
		}

		static bool LoadCube (GLTexturePtr &tex, uni_c_string filename, bool genMipmaps = true) {
			return Load( (GLTextureCubePtr &)tex, filename, genMipmaps );
		}

		static bool LoadCube (GLTexturePtr &tex,
							  uni_c_string positiveX, uni_c_string negativeX,
							  uni_c_string positiveY, uni_c_string negativeY,
							  uni_c_string positiveZ, uni_c_string negativeZ,
							  bool genMipmaps = true) {
			return Load( (GLTextureCubePtr &)tex, positiveX, negativeX, positiveY, negativeY, positiveZ, negativeZ, genMipmaps );
		}
		
		static bool Load2DArray (GLTexturePtr &tex, const uni_array< uni_c_string > &filenames, bool genMipmaps = true) {
			return Load( (GLTexture2DArrayPtr &)tex, filenames, genMipmaps );
		}

		static bool Load3D (GLTexturePtr &tex, uni_c_string filename, bool genMipmaps = true) {
			return Load( (GLTexture3DPtr &)tex, filename, genMipmaps );
		}

		// save //
		//static bool Save(const GLTexture2D *&tex, uni_c_string filename);
	};

}	// Framework
